package zheezes.protocol.impl.gbw.bean;

import zheezes.protocol.impl.gbw.format.DataForm20;
import zheezes.util.ByteUtil;

public class VipFrozenDataParam {
	private short seq;
	private byte days;
	private DataForm20 sdate;

	public int sizeof() {
		return 2 + 1 + 3;
	}

	public int setBytes(byte[] buf, int offset) {
		int idx = offset;
		seq = ByteUtil.ctos(buf, offset);
		idx += 2;
		days = buf[idx++];
		idx = sdate.setBytes(buf, idx);
		return idx - offset;
	}

	public int getBytes(byte[] buf, int offset) {
		int idx = offset;
		ByteUtil.stoc(buf, idx, seq);
		idx += 2;
		buf[idx++] = days;
		idx += sdate.getBytes(buf, idx);
		return idx - offset;
	}

	public short getSeq() {
		return seq;
	}

	public void setSeq(short seq) {
		this.seq = seq;
	}

	public byte getDays() {
		return days;
	}

	public void setDays(byte days) {
		this.days = days;
	}

	public DataForm20 getSdate() {
		return sdate;
	}

	public void setSdate(DataForm20 sdate) {
		this.sdate = sdate;
	}
}
